const fs = require('fs')

//普通读取
// var data = fs.readFileSync('./334882760_cover.jpg')
// fs.writeFileSync('./copyimg.jpg',data)

//流式
var rs = fs.createReadStream('./334882760_cover.jpg')
var ws = fs.createWriteStream('./copy2.jpg')

// rs.on('data',chunk=>{
//     ws.write(chunk)
// })
rs.pipe(ws)